function defineRegistrationWindow(){
	var FORM_ID = 'FormId';
	hf.widget.RegistrationWindow = Ext.extend(Ext.Window, {
		constructor: function(config) {
			Ext.apply(this, {
				title: labels['registration.form.title'],
				shadow: new Ext.Shadow({mode: 'drop'}),
				layout:'fit', 
				width:300, 
				height:200,
				plain: true, 
				modal: true, 
				draggable: false,
				items: [{
					xtype: 'form',
					itemId: FORM_ID,
					url: 'authUser/registration.do',
					frame: true, 
					monitorValid: true,
					items: [ {
							  xtype: 'form-text-field', 
							  name:'j_username',
							  fieldLabel: labels['login.textfield.label'], 
							  blankText: messages['login.textfield.empty.message'], 
							  vtypeText: messages['login.textfield.invalid.message'],
							  vtype: 'alphanum'
							 },
					       	 {
					       	  xtype: 'form-text-field',
					       	  inputType:'password',
					       	  name:'j_password',
					       	  fieldLabel: labels['password.textfield.label'],  
					       	  blankText: messages['password.textfield.empty.message'], 
					       	  vtypeText: messages['password.textfield.invalid.message'],
					       	  vtype: 'alphanum'  
					       	 },
					         {
					          xtype: 'form-text-field', 
					          name: 'firstName',
					          fieldLabel: labels['firstname.textfield.label'], 
					          blankText: messages['firstname.textfield.empty.message'], 
					          vtypeText: messages['firstname.textfield.invalid.message'],
					          vtype: 'alpha'
					         }, 
					         {
					          xtype: 'form-text-field', 
					          name: 'lastName',
					          fieldLabel: labels['lastname.textfield.label'], 
							  blankText: messages['lastname.textfield.empty.message'], 
							  vtypeText: messages['lastname.textfield.invalid.message'],
							  vtype: 'alpha'
							 }
					],
					buttons:[
							{
							 xtype: 'form-button',
							 ref: '../../clearButton',
							 text: labels['clear.button.label'], 
							 iconCls: 'icon-clear', 
							 buttonEvent: 'clear', 
							 tooltip: qtips['qtips.button.clear']
							}, 
					        {
					         xtype: 'form-button',
					         ref: '../../registerButton',
					         text: labels['registration.button.label'], 
					         iconCls: 'icon-register', 
					         buttonEvent: 'register', 
					         formBind: true, 
					         tooltip: qtips['qtips.button.register']
					        }
					]
				}]
				});	
				hf.widget.RegistrationWindow.superclass.constructor.apply(this, arguments);
				
				this.on('register', function(button, event){
		       		this.processRegistration();	
				});
			
			    //
			    this.on('clear', function(button, event){
			    	this.getComponent(FORM_ID).getForm().reset();
			    });
			    
			    this.on('actioncomplete', function(form, action){
			    	this.close();
			    });
			    
			    this.relayEvents(this.getComponent(FORM_ID).getForm(), ['actioncomplete']);
				this.relayEvents(this.clearButton, ['clear']);
				this.relayEvents(this.registerButton, ['register']);
			},
			
			//process user registration method
			processRegistration: function(){
				this.getComponent(FORM_ID).getForm().submit({
					method:'POST', 
					success:function(form, action){
	        			Ext.Msg.alert('', messages['registration.success.alert.message'], function(btn, text){
	        				if (btn == Ext.MessageBox.buttonText.ok.toLowerCase()){
	        					form.reset();
	        				}
	        			});	
					},
					failure:function(form, action){
						if(action.failureType == Ext.form.Action.SERVER_INVALID){
							Ext.Msg.alert(labels['failure.alert.title'], messages['message.error.server.invalid']);
						}else if (action.failureType == Ext.form.Action.CONNECT_FAILURE){
							Ext.Msg.alert(labels['failure.alert.title'], messages['message.error.connect.failure']);
						}else{
							Ext.Msg.alert(labels['failure.alert.title'], messages['registration.failure.alert.message']);
						}
					}
				});	
			}
	});
};